package test02;

import java.util.Scanner;

public class StudentScore {
	private int sid;//序号
	private String sname;//学生姓名
	private Long sno;//学生学号
	private String courseName;//课程名称
	private int grade;//成绩
	//构造一个学生成绩表拥有所有信息的方法,可以赋值到调用参数的方法类上
	public StudentScore(int sid, String sname,Long sno,String courseName,int grade) {
		this.sid=sid;
		this.sname=sname;
		this.sno=sno;
		this.courseName=courseName;
		this.grade=grade;
	}
	//获取序号
	public int getId() {
		return sid;
	}
	//获取学生姓名
	public String getName() {
		return sname;
	}
	//获取学生学号
	public Long getSno() {
		return sno;
	}
	//获取课程名称
	public String getCname() {
		return courseName;
	}
	//获取学生的成绩
	public int getScore() {
		return grade;
	}
	//设置学生的成绩
	public void setGrade(int grade) {
		this.grade=grade;
	}
//	主系统入口 
	public static void main(String[] args) {
        StudentGradeSystem system = new StudentGradeSystem();
        Scanner scanner = new Scanner(System.in);
        int choice = 0;
        do {
            system.Menu();
            System.out.println("请选择操作：");
            choice = scanner.nextInt();
            switch (choice) {             
            	case 1:
                    system.viewStudentScore();
                    break;
                case 2:
                    system.addStudentScore();
                    break;
                case 3:
                    system.UpdateStudentScore();
                    break;
                case 4:
                    system.deleteStudentScore();
                    break;
                case 5:
                    system.calculateCourseStats();
                    break;
                case 6:
                    system.findSGradeBySno();
                    break;
                case 7:
                    system.sortStudentsByScore();
                    break;
                case 8:
                    System.out.println("退出学生成绩系统");
                    break;
                default:
                    System.out.println("无效的操作");
                    break;
            }
        } while (choice != 8);
	}
}
